package com.example.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.time.LocalDateTime;

// 测试被@ControllerAdvice标注的类中使用@InitBinder注解注册的属性编辑器是否全局有效
// 结论：是的，全局有效
@Controller
public class ControllerAdviceAndInitBinderTestController {

    @RequestMapping("/test-controller-advice-and-init-binder")
    public String testControllerAdviceAndInitBinder(@RequestParam LocalDateTime dateTime) {
        System.out.println("dateTime: " + dateTime);
        return "index";
    }
}
